home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / Tools & Goodies / IntlTest / Sources / Part.h < prev    next >
Encoding:
Text File  |  1996-09-12  |  3.7 KB  |  143 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Part.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef PART_H
  11. #define PART_H
  12.  
  13. #ifndef DEFINES_K
  14. #include "Defines.k"
  15. #endif
  16.  
  17. // ----- Framework Includes -----
  18.  
  19. #ifndef FWPART_H
  20. #include "FWPart.h"
  21. #endif
  22.  
  23. // ----- OS Layer -----
  24.  
  25. #ifndef FWRESFIL_H
  26. #include "FWResFil.h"
  27. #endif
  28.  
  29. // ----- Foundation Layer -----
  30.  
  31. #ifndef FWSTDDEF_H
  32. #include "FWStdDef.h"
  33. #endif
  34.  
  35. #ifndef FWBNDSTR_H
  36. #include "FWBndStr.h"
  37. #endif
  38.  
  39.  
  40. //========================================================================================
  41. // Forward Declarations
  42. //========================================================================================
  43.  
  44. class CIntlTestContent;
  45. class CIntlTestFrame;
  46. class CEditView;
  47. class CIntlTestSelection;
  48. class CMyEditView;
  49.  
  50. //========================================================================================
  51. // CIntlTestPart
  52. //========================================================================================
  53.  
  54. class CIntlTestPart : public FW_CPart
  55. {
  56.   public:
  57.     FW_DECLARE_AUTO(CIntlTestPart)
  58.     
  59. //----------------------------------------------------------------------------------------
  60. //    Initialization/Destruction
  61. //
  62.   public:
  63.     CIntlTestPart(ODPart* odPart);
  64.     virtual ~CIntlTestPart();
  65.  
  66.     virtual void Initialize(Environment* ev, ODStorageUnit* storageUnit, FW_Boolean fromStorage);
  67.  
  68. //----------------------------------------------------------------------------------------
  69. //    Inherited API
  70. //
  71.   public:
  72.     virtual FW_CContent* NewPartContent(Environment* ev);
  73.  
  74.     virtual FW_CFrame*    NewFrame(Environment* ev,
  75.                                  ODFrame* odFrame,
  76.                                  FW_CPresentation* presentation,
  77.                                  FW_Boolean fromStorage);
  78.  
  79.     virtual FW_Handled    DoAbout(Environment* ev);
  80.  
  81.     virtual FW_Handled    DoAdjustMenus(Environment* ev,
  82.                                       FW_CMenuBar* menuBar, 
  83.                                       FW_Boolean hasMenuFocus,
  84.                                       FW_Boolean isRoot);
  85.  
  86.     virtual FW_Handled    DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
  87.  
  88. //----------------------------------------------------------------------------------------
  89. //    New API
  90. //
  91.   public:
  92.     CIntlTestContent*    GetPartContent();
  93.     CIntlTestSelection*    GetTestSelection();
  94.     ODID                WhichEditViewIsActive(Environment* ev);
  95.  
  96.     void                UpdateTextData(Environment* ev);
  97.     void                UpdateViewsFromTextData(Environment* ev);
  98.  
  99.   private:
  100.     void                InitializeMenus(Environment* ev);
  101.  
  102.     void                OpenOperatorTestDialog(Environment* ev);
  103.     void                OpenReaderTestDialog(Environment* ev);
  104.     void                OpenNumberTestDialog(Environment* ev, ODCommandID id);
  105.  
  106.     CMyEditView*        GetActiveEditView(Environment* ev);
  107.  
  108. //----------------------------------------------------------------------------------------
  109. //    Data Members
  110. //
  111.   private:
  112.     CIntlTestContent*    fPartContent;
  113.     CIntlTestSelection*    fTestSelection;
  114.     FW_CPresentation*    fMainPresentation;
  115.     FW_CPresentation*    fOpTestPresentation;
  116.     FW_CPresentation*    fReaderTestPresentation;
  117.     FW_CPresentation*    fNumberTestPresentation;
  118.     CIntlTestFrame*        fTestFrame;
  119. };
  120.  
  121. //----------------------------------------------------------------------------------------
  122. inline CIntlTestContent* CIntlTestPart::GetPartContent()
  123. {
  124.     return fPartContent;
  125. }
  126.  
  127. //----------------------------------------------------------------------------------------
  128. inline CIntlTestSelection* CIntlTestPart::GetTestSelection()
  129. {
  130.     return fTestSelection;
  131. }
  132.  
  133. //========================================================================================
  134. extern FW_CString MyLoadRStringByID(Environment* ev,
  135.                              FW_PResourceFile& file,
  136.                              FW_ResourceID resourceId,
  137.                              FW_ResourceType resourceType);
  138.  
  139. extern FW_Locale gJapaneseLocale;
  140.  
  141.  
  142. #endif
  143.